package mjy.listener;

import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;


@Component
public class RabbitConsumer {
    @RabbitListener(queues = "QA")
    public void xxx(Message msg, Channel channel) throws IOException {
        String s = new String(msg.getBody());

        System.out.println("队列QA接收到消息："+s);
    }

    @RabbitListener(queues = "QB")
    public void yyy(Message msg, Channel channel)throws IOException{
        String s = new String(msg.getBody());

        System.out.println("队列QB接收到消息："+s);
    }
}
